<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
      name="viewport">
<link type="text/css" rel="stylesheet" href="../addons/{php echo $this->modulename}/template/mobile/css/bootstrap.min.css">
<script type="text/javascript" src="../addons/{php echo $this->modulename}/template/mobile/js/jquery-1.7.2.min.js"></script>
<title>{$rule['stitle']}</title>
<style>
*{
	margin: 0;
	padding: 0;
}

.userinfo{
	width: 80%;
	left: 10%;
	margin-top: 20%;
	z-index: 100;
	position: absolute;
}

.userinfo label{
	width: 50px;
}

.userinfo input{
	display: inline-block;width: 60%;
}

.userinfo textarea{
	display: inline-block;width: 60%;
}

.userinfo .form-group{
	margin-bottom: 5px;
}

.users{
	width:30%;
	display: inline-block;
	text-align: center;
}

.blessing{
	position: absolute;
	width: 80%;
	left: 10%;
	text-align: center;
	padding: 10px;
	top: 40%;
	background: rgb(255,128,255);
	border: 1px solid white;
	border-radius: 5px;
	font-size: 16px;
	display: none;
}

.blessing label{
	color: orangered;
	font-weight: bold;
	font-size: 20px;
}
</style>
</head>
<body>
{template 'common'}
<div style="text-align: center;position: absolute;top: 60%;width: 100%;">{if empty($share)}<button style="margin-right: 30px;" class="btn btn-danger" onclick="onBlessing(this)">送祝福</button>{/if}<a href="{php echo $this->createMobileUrl('index',array('rid'=>$rid,'op'=>'share'))}" class="btn btn-warning">我也搭桥</a></div>
<div class="blessing" onclick="location.reload();">你的祝福化作了 <label id="count">10</label> 只喜鹊，共同为<label> {$player['myname']} </label>和<label> {$player['hname']} </label>搭建幸福的鹊桥!</div>
</body>
<script type="text/javascript">
function onBlessing(obj){
	{if !empty($rule['describe_limit2']) && !$follow}
	{php $url = $this->module['config']['describeurl'];}
		{if empty($url)}
			$('#describe').show();
			return;
		{else}
			alert('请先关注公众号！');
			location.href='{$url}';		
			return;
		{/if}
	{/if}
	
	$(obj).attr('disabled',true);
	$.ajax({
		url:"{php echo $this->createMobileUrl('bless',array('rid'=>$rid,'pid'=>$pid))}",
		type:'post',
		dataType:'json',
		success:function(data){
			if(data['code'] == 1){
				$('#count').text(data['count']);
				$('.blessing').show();
			}else{
				alert(data['msg']);
				location.reload();
			}
		},
		error:function(){
			alert('发送请求失败，请重试！');
		}
	});
}
</script>
</html>